import { ref } from "vue";
import type { AvueFormOption } from "@smallwei/avue";

export default function () {
  const option: AvueFormOption = {
    menuBtn: false,
    labelWidth: 110,
    column: [
      {
        type: "select",
        prop: "typeId",
        label: "分类",
        dicUrl: "/api/messageType/list",
        props: {
          label: "typeName",
          value: "id",
        },
        rules: [
          {
            required: true,
            message: "请选择分类",
          },
        ],
      },
      {
        prop: "title",
        label: "标题",
        search: true,
        rules: [
          {
            required: true,
            message: "请输入标题",
          },
        ],
      },
      {
        type: "ueditor",
        span: 24,
        label: "内容",
        prop: "content",
        action: "/api/upload",
      },
    ],
  };
  return ref(option);
}
